package com.sctvcloud.linshui.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.linshui.R;
import com.sctvcloud.linshui.beans.FRebellion;
import com.sctvcloud.linshui.ui.adapter.holder.ApplyHolder;
import com.sctvcloud.linshui.ui.adapter.holder.BaseRebllionHolder;
import com.sctvcloud.linshui.ui.adapter.holder.ChatRoomMsgHolder;
import com.sctvcloud.linshui.ui.adapter.holder.TopicHolder;
import com.sctvcloud.linshui.ui.util.IListShowData;

import java.util.List;

import cn.jpush.im.android.api.model.Message;

/**
 * 聊天室消息列表
 */
public class ChatRoomMsgAdapter extends BaseHolderAbsAdapter<Message, ChatRoomMsgHolder> {
    private boolean my;
    private ChatRoomMsgHolder.OnChatItemClickListener listener;

    public boolean isMy() {
        return my;
    }

    public void setMy(boolean my) {
        this.my = my;
    }

    public ChatRoomMsgAdapter(Context context, List<Message> list, ChatRoomMsgHolder.OnChatItemClickListener listener) {
        super(context, list);
        this.listener = listener;
    }


    @Override
    public ChatRoomMsgHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        ChatRoomMsgHolder msgHolder;
        LayoutInflater inflater = LayoutInflater.from(context);

        msgHolder = new ChatRoomMsgHolder(context, inflater.inflate(R.layout.item_chat_room_msg, parent, false),listener);

        return msgHolder;
    }

    @Override
    public int getItemViewType(int position) {
        return 0;
    }


}
